﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>订单列表</title>
    <link rel="shortcut icon" href="favicon.ico">
    @Styles.Render("~/css/admin")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox-title">
            <h5>充值订单列表</h5>
        </div>
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <table id="tb_Order"></table>
                </div>
            </div>
        </div>
    </div>
    <!--table工具栏-->
    <div id="toolbar">
        @*<button type="button" class="btn btn-outline btn-default" onclick="add('添加')">
            <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
        </button>*@
    </div>
    <!--编辑框-->
    <div id="edit" class="container-fluid" style="display:none;">
        <div class="ibox-content">
            <form enctype="multipart/form-data" id="form_edit" class="form-horizontal" method="post" action="/Admin/WebSite/Edit_ConfigPayMent">
                <input id="ID" name="ID" style="display:none;" />

                <div class="form-group">
                    <label class="col-sm-3 control-label">支付名称：</label>
                    <div class="col-sm-8">
                        <input id="title" name="title" class="form-control" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">商户目录名：</label>
                    <div class="col-sm-8">
                        <select id="name" name="name" data-placeholder="选择目录" class="chosen-select" tabindex="4">
                            <option value="">请选择目录</option>
                            <option value="weixin">微信官网目录</option>
                            <option value="yifubao">易付宝目录</option>
                            <option value="dinpay">智付目录</option>
                            <option value="mopay">摩宝目录</option>
                            <option value="yompay">优付目录</option>
                            <option value="shanpay">闪付目录</option>
                            <option value="qianpay">钱海支付目录</option>
                            <option value="shangpay">商银目录</option>
                            <option value="tonghui">通汇目录</option>
                            <option value="kuaifu">快付</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">商户号：</label>
                    <div class="col-sm-8">
                        <input id="mch_id" name="mch_id" class="form-control" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">商户密钥：</label>
                    <div class="col-sm-8">
                        <input id="api_key" name="api_key" class="form-control" />
                    </div>
                </div>
                <div class="form-group" name="wechat" id="fileShow">
                    <label class="col-sm-3 control-label">文件名：</label>
                    <div class="col-sm-8">
                        <input id="file" name="file" readonly style="width:242px;">
                        <a style="margin-left:10px;" href="javascript:ANewUpload()">重新上传</a>
                    </div>
                </div>
                <div class="form-group" name="wechat" id="fileUp">
                    <label class="col-sm-3 control-label">文件上传：</label>
                    <div class="col-sm-8">
                        <input style="float:left" id="choosefile" name="choosefile" type="file" title="请选择要上传的文件" />
                        <a style="margin-left:10px;" href="javascript:cancelFile()">取消</a>
                    </div>
                </div>
                <div class="form-group" name="wechat">
                    <label class="col-sm-3 control-label">微信APPID：</label>
                    <div class="col-sm-8">
                        <input id="app_id" name="app_id" class="form-control" />
                        <span style="color:red">微信必填</span>
                    </div>
                </div>
                <div class="form-group" name="wechat">
                    <label class="col-sm-3 control-label">微信APPSECRET：</label>
                    <div class="col-sm-8">
                        <input id="app_secret" name="app_secret" class="form-control" />
                        <span style="color:red">微信必填</span>
                    </div>
                </div>
                <div class="form-group" name="wechat">
                    <label class="col-sm-3 control-label">微信开启类型：</label>
                    <div class="col-sm-8">
                        <input id="gzh" type="radio" name="wx_type" value="0" checked /><label for="gzh" style="margin-right:10px;">公众号</label>
                        <input id="QR" type="radio" name="wx_type" value="1" /><label for="QR">二维码</label>
                    </div>
                </div>
                <div class="form-group zhifu" name="zhifu">
                    <label class="col-sm-3 control-label">绑定域名：</label>
                    <div class="col-sm-8">
                        <input id="domain" name="domain" class="form-control" />
                        <span style="color:red">第三方要求的域名，不要输入http://</span>
                    </div>
                </div>
                <div class="form-group zhifu" name="zhifu">
                    <label class="col-sm-3 control-label">公钥：</label>
                    <div class="col-sm-8">
                        <textarea id="public_key" name="public_key" style="width:60%; height:160px;"></textarea>
                    </div>
                </div>
                <div class="form-group zhifu" name="zhifu">
                    <label class="col-sm-3 control-label">私钥：</label>
                    <div class="col-sm-8">
                        <textarea name="private_key" style="width:60%; height:160px;"></textarea>
                    </div>
                </div>
            </form>
        </div>
    </div>
    @Scripts.Render("~/js/admin")
</body>
</html>
<script type="text/javascript">
    $(function () {
        function operateFormatter(value, row, index) {//赋予的参数
            if (value == 'N') {

            }
            return [
            '<a onclick="OrderNot(' + row.ID + ')" style="margin-right: 10px; cursor: pointer; color:red;">订单不符</a>',
            '<a onclick="OrderNot(' + row.ID + ')" style=" cursor: pointer; ">没有订单</a>',
            ].join('');
        }
        function formatterIs_Check(value, row, index) {
            if (value == 'N') {
                //return '未到账';
                return '';
            } else if (value == 'Y') {
                return '已到账';
            } else {
                return value;
            }
        }
        $('#tb_Order').bootstrapTable({
            url: '/admin/Order/Get_OrderList',
            uniqueId: 'id',
            toolbar: '#toolbar',
            pagination: true,//是否分页
            sidePagination: "server",//分页方式本地还是服务器
            pageSize: 25,
            pageList: [25, 50, 100],
            queryParamsType:'',//如果要获取pagesize、pagenumber必须设置这个参数。否则就只能得到limit
            queryParams: function (params) {
                return {
                    pageSize: params.pageSize,
                    pageNumber: params.pageNumber
                }
                //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                //limit: params.limit,   //页面大小
                //offset: params.offset,  //页码
                //可以自定义筛选
                //search: params.search       //加了这个，就可以使用自带的搜索功能了
            },
            columns: [{
                field: 'id',
                title: '序号'
            },
            {
                field: 'order_no',
                title: '订单编号'
            },
            {
                field: 'username',
                title: '会员名称'
            },
            {
                field: 'amount',
                title: '充值金额',
            }, {
                field: 'addtime',
                title: '提交时间'
            }, {
                field: 'pay_type',
                title: '支付渠道'
            }, {
                field: 'trade_no',
                title: '第三方订单号'
            }, {
                field: 'is_check',
                title: '到账状态',//状态
                formatter: formatterIs_Check
            },
            {
                field: 'yichang',
                title: '平台',//N没有异常，Y有异常，C异常处理过，T就是状态为没有订单
                formatter: operateFormatter//自定义
            },
            {
                field: 'yc_time',
                title: '处理时间'//
            }],
        })
    })
</script>